This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to simplify the usage of the
MockedProvider
.Note, that the changes that I am proposing are breaking!
1. Remove
removeTypename
prop.Whenever I am writing a test I want to simply be able to write
However, by default the
MockedProvider
adds typenames to everything in the cache. This caused the example above to fail and forces the user to write:This PR removes the
removeTypename
prop and simply forces the cache to not add typenames to documents it receives.I hope that this change will simplify the usage of the MockedProvider and prevent users from having to worry about whether to remove typenames or not.
Are there any use-cases that I am missing by removing this prop? Would love to hear them. I couldn’t come up with a reason for this prop being there.
2. Remove the
client
propThe
MockedProvider
allows the user to pass a customclient
prop. However thisclient
is passed straight to the theApolloProvider
. So I removed this prop and instead of letting the user do this:The user can use the normal
ApolloProvider
: